import { Carousel, Col } from 'antd';
import React, { useState } from 'react';

export const Banner: React.FC<any> = props => {
  const [data, setData] = useState([
    {
      id: '0',
      imgUrl: '/img/xwjy_banner.jpg',
      jumpUrl: undefined,
      title: '购物平台',
    },
    {
      id:'1',
      imgUrl:'/img/good3.png'
    }
  ]);

  return (
    <>
      {data && data.length > 0 && (
        <Col style={{ padding: 0, marginBottom: 16 }}>
          <Carousel autoplay>
            {data.map((m: any, idx: any) => {
              return (
                <a key={idx} target="_blank">
                  <img
                    alt="do not show"
                    src={m.imgUrl}
                    style={{ width: '100%', height: 350 }}
                  ></img>
                </a>
              );
            })}
          </Carousel>
        </Col>
      )}
    </>
  );
};
